package com.andrew.service;

import java.io.IOException;
import java.sql.SQLException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.andrew.entity.Book;
import com.andrew.entity.PageBean;

public interface BookService {
	/**
	 * 获取一页的书本信息
	 * @return	返回类中包括 一页中的书本集合，总页数，当前页数，总书本数，每页书本数
	 */
	public abstract PageBean getBooksByPage(String queryTerm,int currentPage) throws SQLException;
	
	public void addBook(HttpServletRequest req,HttpServletResponse resp)throws SQLException,IOException;
	
	/**
	 * 改变库存
	 * @param bookId
	 * @param quantity
	 * @throws SQLException
	 */
	public abstract int changeStocks(int bookId,int quantity) throws SQLException;
	/***
	 * 修改图书信息
	 * @return success:成功 fail：失败
	 * @throws SQLException
	 */
	public void updateBookInfo(HttpServletRequest req,HttpServletResponse resp)throws SQLException, IOException;
	
	/***
	 * 管理员查看图书
	 * @param req
	 * @param resp
	 * @throws SQLException
	 * @throws IOException
	 */
	public void queryBook(HttpServletRequest req,HttpServletResponse resp)throws SQLException, IOException;
	
	/***
	 * 修改图书的照片
	 * @param req
	 * @param resp
	 * @throws SQLException
	 * @throws IOException
	 */
	public void ChangePictureForPicture(HttpServletRequest req,HttpServletResponse resp)throws SQLException, IOException;
	
}
